1. Field of the Invention
The present invention generally relates to a system, a controller, and a method for transmitting and distributing a data stream, and particularly, to a system, a controller, and a method for transmitting and distributing a data stream from a host to a storage device with a flash memory and a chip.
2. Description of Related Art
Digital cameras, cell phones and MP3 players have grown rapidly in recent years, which results in a quick increase in demand of storage media by users. Because of the advantages of non-volatility, power saving, small dimension, and having no mechanical structure, the flash memories are very suitable to be embedded in various portable multimedia devices as described above.
On the other hand, the user's increasing acceptance of electronic wallet and prepayment has resulted in increasing popularization of smart cards. The smart card is typically an integrated circuit (IC) chip which includes, for example, a microprocessor, a card operation system, a security module, and a memory module to allow predetermined operation performed by an owner of the smart card. With the ability to provide computing, encryption, bidirectional communication and security functions, the smart card not only can store data, but also can protect the data stored therein. One exemplary smart card is the subscriber identification module (SIM) of cellular phones that use global system for mobile communication (GSM). However, the smart card has a limit in its storage capacity. Thus, the smart card has recently begun to use in combination with a large storage memory card to expand the storage capacity of the smart card.
Conventionally, use of the smart card in combination with a flash memory, a particular command is used to differentiate the data transmitted to the smart card from the data transmitted to the flash memory. This particular command may not be supported by the hardware or the driver. Moreover, in the prior art, information of the particular command, which regards the type of the transmitted data stream, is compared to determine whether the transmitted data stream is of the command format of the smart card. However, this method often results in confusion of the command data of the smart card with the normal data of the flash memory (i.e., misinterpreting the normal data of the flash memory as the command data of the smart card).
In addition, in utilization of electronic products with a cache, due to the electronic products' own limits, data stream transmission between the smart card and the electronic product cannot bypass the cache, which makes a response message generated by the smart card unable to be inerrably transmitted back to the electronic product that the smart card is attached to, thereby restraining the applications of the smart card on such electronic product having a cache. For example, in a cell phone with a Java system, since the Java system does not support commands, e.g. the command of NO Cache, that allows directly access to the flash memory without using the cache, it can be difficult to combine the smart card and flash memory into a memory card in the cell phone with the Java system. FIG. 1 is a functional block diagram of a host 10 equipped with a memory card 12. Referring to FIG. 1, the host is a type of electronic product (e.g., a cell phone with a Java system) and has a cache 14. The memory card 12 includes a flash memory 16 and a smart card chip 18. All data between the host 10 and the memory 12 is transmitted through the cache 14. However, since the cache temporarily stores recent data transmitted between the host 10 and the memory card 12, when the host 10 acquires data from the smart card chip 18, if the cache 14 already contains data matched with the address designated by the read command, the cache 14 will transmit the matched data to the host 10. However, in such a system, the response message of the smart card chip 18 may be often substituted by the data already existing in the cache 14, which significantly affects the encryption and security communication of the smart card chip 18.
Therefore, a system and a method that can inerrably transmit the response message of the smart card are required. In such system, a flash memory is used in combination with the smart card.